package com.mooc.meetingfilm.utils.common.vo;

import com.mooc.meetingfilm.utils.exception.CommonServiceException;
import lombok.Data;

/**
 * <h1>分页请求类</h1>
 */
@Data
public class BasePageVO extends BaseRequestVO{

    private Integer nowPage = 1;
    private Integer pageSize = 10;

    @Override
    public void checkParam() throws CommonServiceException {
        if ((nowPage != null && nowPage != 0) && (pageSize != null && pageSize != 0)) {
            return;
        } else {
            throw new CommonServiceException(404, "nowPage or pageSize must be required and not zero");
        }
    }

}
